//
//  ViewController.m
//  修改手机定位
//
//  Created by chenleping on 2018/10/31.
//  Copyright © 2018年 DSY. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@property (nonatomic, strong) NSArray * array1;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor yellowColor];

    
    NSString * str1 = @"1";
    NSString * str2 = str1;
    NSLog(@"%x", str1);
    NSLog(@"%p", str1);
    NSLog(@"%p", str2);
    str2 = @"2";
    NSLog(@"%p", str1);
    NSLog(@"%p", str2);
    
    NSArray * array = @[@"1"];
    NSArray * arrayCopy = [array copy];
//    NSLog(@"%x", &array);
//    NSLog(@"%x", &arrayCopy);
    
    NSLog(@"%p", array);
    NSLog(@"%p", arrayCopy);
    
    array = @[@"1"];
    NSLog(@"%p", array);
    NSLog(@"%p", arrayCopy);
    
    NSMutableArray * mutableArray = [array mutableCopy];
    NSLog(@"%p", mutableArray);
    [mutableArray addObject:@"2"];
    NSLog(@"%@", mutableArray);
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    NSMutableArray * mArray = [NSMutableArray arrayWithArray:@[@"1"]];
    self.array1 = mArray;
    NSLog(@"%p", mArray);
    NSLog(@"%p", self.array1);
    [mArray addObject:@"2"];
    NSLog(@"%@", mArray);
    NSLog(@"%@", self.array1);
}



@end
